/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bs.Beans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Bone
 */
@Entity
@Table(name = "tribut_operacao_fiscal")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TributOperacaoFiscal.findAll", query = "SELECT t FROM TributOperacaoFiscal t")})
public class TributOperacaoFiscal implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Integer id;
    @Column(length = 100)
    private String descricao;
    private Integer cfop;
    @Column(name = "DESCRICAO_NA_NF", length = 100)
    private String descricaoNaNf;
    @Lob
    @Column(length = 65535)
    private String comentario;
    @Lob
    @Column(name = "MENSAGEM_FISCAL", length = 65535)
    private String mensagemFiscal;
    @OneToMany(mappedBy = "idOperacaoFiscal")
    private List<Cliente> clienteList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idOperacaoFiscal")
    private List<TributIpiDipi> tributIpiDipiList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idTributOperacaoFiscal")
    private List<TributCofinsCodApuracao> tributCofinsCodApuracaoList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idTributOperacaoFiscal")
    private List<TributIss> tributIssList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idTributOperacaoFiscal")
    private List<TributIcmsCustomizado> tributIcmsCustomizadoList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idTributOperacaoFiscal")
    private List<TributPisCodApuracao> tributPisCodApuracaoList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idTributOperacaoFiscal")
    private List<TributIcmsUf> tributIcmsUfList;
    @JoinColumn(name = "ID_EMPRESA", referencedColumnName = "ID", nullable = false)
    @ManyToOne(optional = false)
    private Empresa idEmpresa;

    public TributOperacaoFiscal() {
    }

    public TributOperacaoFiscal(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    public Integer getCfop() {
        return cfop;
    }

    public void setCfop(Integer cfop) {
        this.cfop = cfop;
    }

    public String getDescricaoNaNf() {
        return descricaoNaNf;
    }

    public void setDescricaoNaNf(String descricaoNaNf) {
        this.descricaoNaNf = descricaoNaNf;
    }

    public String getComentario() {
        return comentario;
    }

    public void setComentario(String comentario) {
        this.comentario = comentario;
    }

    public String getMensagemFiscal() {
        return mensagemFiscal;
    }

    public void setMensagemFiscal(String mensagemFiscal) {
        this.mensagemFiscal = mensagemFiscal;
    }

    @XmlTransient
    public List<Cliente> getClienteList() {
        return clienteList;
    }

    public void setClienteList(List<Cliente> clienteList) {
        this.clienteList = clienteList;
    }

    @XmlTransient
    public List<TributIpiDipi> getTributIpiDipiList() {
        return tributIpiDipiList;
    }

    public void setTributIpiDipiList(List<TributIpiDipi> tributIpiDipiList) {
        this.tributIpiDipiList = tributIpiDipiList;
    }

    @XmlTransient
    public List<TributCofinsCodApuracao> getTributCofinsCodApuracaoList() {
        return tributCofinsCodApuracaoList;
    }

    public void setTributCofinsCodApuracaoList(List<TributCofinsCodApuracao> tributCofinsCodApuracaoList) {
        this.tributCofinsCodApuracaoList = tributCofinsCodApuracaoList;
    }

    @XmlTransient
    public List<TributIss> getTributIssList() {
        return tributIssList;
    }

    public void setTributIssList(List<TributIss> tributIssList) {
        this.tributIssList = tributIssList;
    }

    @XmlTransient
    public List<TributIcmsCustomizado> getTributIcmsCustomizadoList() {
        return tributIcmsCustomizadoList;
    }

    public void setTributIcmsCustomizadoList(List<TributIcmsCustomizado> tributIcmsCustomizadoList) {
        this.tributIcmsCustomizadoList = tributIcmsCustomizadoList;
    }

    @XmlTransient
    public List<TributPisCodApuracao> getTributPisCodApuracaoList() {
        return tributPisCodApuracaoList;
    }

    public void setTributPisCodApuracaoList(List<TributPisCodApuracao> tributPisCodApuracaoList) {
        this.tributPisCodApuracaoList = tributPisCodApuracaoList;
    }

    @XmlTransient
    public List<TributIcmsUf> getTributIcmsUfList() {
        return tributIcmsUfList;
    }

    public void setTributIcmsUfList(List<TributIcmsUf> tributIcmsUfList) {
        this.tributIcmsUfList = tributIcmsUfList;
    }

    public Empresa getIdEmpresa() {
        return idEmpresa;
    }

    public void setIdEmpresa(Empresa idEmpresa) {
        this.idEmpresa = idEmpresa;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TributOperacaoFiscal)) {
            return false;
        }
        TributOperacaoFiscal other = (TributOperacaoFiscal) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bs.Beans.TributOperacaoFiscal[ id=" + id + " ]";
    }
    
}
